import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  scrollBehavior: () => ({ left: 0, top: 0 }),
  routes: [
    {
      path: '/',
      name: 'home',
      component: () => import('@/views/HomeView.vue'),
    },
    {
      name: 'login',
      path: '/login',
      component: () => import('@/views/login.vue'),
      meta: {},
    },
    // {
    //   name: 'home',
    //   path: '/home',
    //   component: () => import('@/views/home.vue'),
    //   meta: {
    //     flag: true,
    //   },
    //   children: [
    //     {
    //       path: 'user',
    //       name: 'user',
    //       component: () => import('@/views/power/user.vue'),
    //       meta: {},
    //     },
    //   ]
    // },
    {
      name: 'NotFound',
      path: '/:pathMatch(.*)*',
      component: () => import('@/views/404.vue'),
      meta: {},
    },
  ],
})

export default router
